package com._21cn.framework.base.db;

import com._21cn.framework.flip.PageList;

import java.util.Collection;
import java.util.Map;

/**
 * Created by 司徒海富 on 2016/5/24.
 */
public interface BaseDao<T> {

    public T selectById(Object id);

    public PageList<T> selectByMap(Map<String,Object> params, int pageNo, int pageSize, boolean doCount);

    public PageList<T> selectByMap(Map<String,Object> params, int pageNo, int pageSize);

    public int selectCountByMap(Map<String,Object> params);

    public void insert(T object);

    public int batchInsert( final Collection<T> objects );

    public int batchInsert( final T... objects );

    public int updateByMap(Map<String,Object> params);

    public int update(T object);

    public int batchUpdate( final Collection<T> objects );

    public int batchUpdate( final T... objects );

    public int deleteByMap(Map<String,Object> params);

    public int deleteById(Object id);

    public int batchDeleteById( final Collection<?> objects );

    public int batchDeleteById( final Object[] objects );

}
